<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>location</title>
</head>
<body>
	<div>点我打开新文档</div>
</body>
<script type="text/javascript">
// location  包含了当前url的信息，如：端口号，协议，网址路径等等
	console.log(location);
	document.getElementsByTagName("div")[0].onclick = function(){
		// 替换当前文档
		location.replace("new2.html");
		// 打开新文档
		location.assign("new1.html");
	}
</script>
</html>